//
//  THPopViewManager.m
//  MengLiao
//
//  Created by xiuxin on 2022/7/15.
//  Copyright © 2022 BaseBusiness. All rights reserved.
//

#import "THPopViewManager.h"
#import "THPopView.h"
@interface THPopViewManager ()

@property (nonatomic,retain) NSMutableArray <THPopView*>*poolList;

@end

@implementation THPopViewManager

+ (instancetype)shareInstance{
    static dispatch_once_t onceToken;
    static THPopViewManager *_instancePopViewManager = nil;
    dispatch_once(&onceToken, ^{
        _instancePopViewManager = [[THPopViewManager alloc] init];
    });
    return _instancePopViewManager;
}
- (instancetype)init{
    if (self = [super init]) {
        _poolList = [[NSMutableArray alloc] init];
    }
    return self;
}
- (BOOL)isExistPopView{
    return _poolList.count > 0;
}
- (void)pushView:(THPopView*)popView{
    if (!popView) return;
    [_poolList addObject:popView];
}
- (void)popView:(THPopView*)popView{
    if (!popView) return;
    [_poolList removeObject:popView];
}
- (THPopView*)lastPopView{
    return _poolList.firstObject;
}


@end
